{extend name="public/base"}

{block name="x-body"}
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" method="get">
          <div class="layui-input-inline">
            <select name="cate_id">
              <option value="">全部分类</option>
            </select>
          </div>
          <div class="layui-input-inline">
            <select name="is_on_sale">
              <option value="">全部商品</option>
            </select>
          </div>
          <input type="text" name="goods_name"  placeholder="请输入搜索词" autocomplete="off" class="layui-input" value="">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <xblock>
        <button class="layui-btn layui-btn-danger" onclick="delAll('{:url(\'goods/comment_del\')}')"><i class="layui-icon"></i>批量删除</button>
        <span class="x-right" style="line-height:40px">共有数据：{$list -> total()} 条</span>
      </xblock>
      <table class="layui-table layui-form">
        <thead>
          <tr>
            <th>
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>id</th>
            <th>用户名称</th>
            <th>评论内容</th>
            <th>评论商品</th>
            <th>评论时间</th>
            <th>ip地址</th>
            <th>显示</th>
            <th >操作</th>
            </tr>
        </thead>
        <tbody>
          {volist name="list" id="v"}
          <tr>
            <td>
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$v.id}'><i class="layui-icon">&#xe605;</i></div>
            </td>
            <td>{$v.id}</td>
            <td>{$v.username}</td>
            <td>{$v.content|interceptStr=###}</td>
            <td>{$v.goods_name}</td>
            <td>{$v.add_time|date="Y-m-d H:i:s"}</td>
            <td>{$v.ip_address}</td>
            <td style="width: 5%;">
              <input type="checkbox" name="switch" data-id="{$v.id}" data-status="{$v.is_show}" lay-text="是|否" {if $v.is_show == 1}checked=""{/if} lay-skin="switch" >
            </td>
            <td class="td-manage">
              <a title="查看"  onclick="x_admin_show('查看','{:url(\'goods/comment_cat\', [\'id\' => $v.id])}')" href="javascript:;">
                <i class="layui-icon">&#xe63c;</i>
              </a>
              <a title="删除" onclick="member_del(this,'{$v.id}', '{:url(\'goods/comment_del\')}')" href="javascript:;">
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
          </tr>
          {/volist}
        </tbody>
      </table>
      <div class="page">
        {$list -> render()|raw}
      </div>

    </div>
<script>
    $(document).ready(function (){
        /**
         * 更新状态
         */
        editStatus('{:url("goods/commentStatus")}', 'is_show');
    });
</script>
{/block}